Compilers for programming languages within computer systems routinely check for syntax errors before they will attempt to compile a program. This type of checking may be done prior to the compilation process or it may be done as part of the compilation process. Syntax errors include such things as misspelled key words, unbalanced parenthesis, undefined variables, etc. The newest compilers even combine a text editor with the compiler so that syntax is checked when a programming statement is typed in by a programmer. This allows the errors to be detected at the earliest possible moment.
While syntax error checking is very important, and must be performed if a program is to compile, it is desirable that checking for logical errors also be performed. Logical errors include performing statements in a illogical sequence, failing to perform statements that need to be performed, and even includes such things as typographical errors that would otherwise go undetected because they are syntactically correct. Most textbooks that teach how to use a programming language also include suggestions on avoiding many types of logical errors. Some books have been entirely devoted to the teaching of ways to avoid logical errors, for example, "Effective C++" by Scott Meyers, Addison Wesley Publishing Company, 1992. The subtitle of this book is "50 Specific Ways to Improve Your Programs and Designs". This same author, Scott Meyers, has also written other books and articles on detection of programming errors, such as "Automatic Detection of C++ Programming errors: initial Thoughts on a lint++", published at the 1991 USENIX Conference.
While books have suggested some errors, and some compilers and text editors include checking for a few of these errors, many more are not identified in books and have yet to be programmatically implemented. While books are an effective teaching tool, no one reads every book, so a computer implementation of the rules is a vast improvement over simply mentioning the rules within a book. Furthermore, books teach people how to avoid these problems, but they seldom provide a logical method whereby a program can perform an automatic check to detect a rule violation.
There is need in the art then, for an improved method for detecting logical errors within a program. There is further need in the art, for a system that will detect many logical errors and inform a programmer when these logical errors are committed. The present invention meets these and other needs in the art.